package com.ftqh.tutorial.controller;

import com.ftqh.tutorial.service.ComputeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by Administrator on 2017/4/27.
 */
@RestController
public class ConsumerController {
    @Autowired
    ComputeService computeService;

    @GetMapping("/add")
    public String add() {
        return computeService.add();
    }

    @GetMapping("/users/{id}")
    public String getUser(@PathVariable Integer id) {
        return computeService.getUser(id);
    }
}
